package Model;

import zOthers.Log;

public class ModelPanelGame extends AbstractModel{
	static private final String TAG = "ModelPanelGame";
	private Integer screenID;

	private boolean isModelInitialized;	// This flag will be set to true when initialization is finished

	private Integer panelGameWidth;
	private Integer panelGameHeight;

	/*
	 * This method is only called when the view is visualized for the first time
	 */
	public void modelInitialization() {

		setPanelStartMenuWidth(800);
		setPanelStartMenuHeight(700);
		setIsModelInitialized(true);
		setScreenID(ModelPanelStartMenu.SCREEN_ID_BASIC);
	}

	public void setTest(Integer unsed){
		System.out.println("TestPressed");
		Log.info(TAG, "test button pressed");
	}


	/*
	 * Mutators
	 */
	public void setPanelStartMenuWidth(Integer pMW) {
		System.out.println(this.getClass().toString() + ".setPanelStartMenuWidth() called");
		Integer OldPanelStartMenuWidth;
		if(panelGameWidth == null)
			OldPanelStartMenuWidth = -1;
		else
			OldPanelStartMenuWidth = panelGameWidth;
		panelGameWidth = pMW;
		firePropertyChange("panelStartMenuWidth", OldPanelStartMenuWidth, panelGameWidth);
	}

	public void setPanelStartMenuHeight(Integer pMH) {
		Integer OldPanelStartMenuHeight;
		if(panelGameHeight == null)
			OldPanelStartMenuHeight = -1;
		else
			OldPanelStartMenuHeight = panelGameHeight;
		panelGameHeight = pMH;
		firePropertyChange("panelStartMenuHeight", OldPanelStartMenuHeight, panelGameHeight);
	}


	public void setScreenID(Integer sId) {
		Integer oldScreenID;
		if(screenID == null)
			oldScreenID = -1;
		else
			oldScreenID = screenID;
		screenID = sId;
		firePropertyChange("screenID", oldScreenID, screenID);
	}

	public void setIsModelInitialized(boolean iMI) {
		boolean oldIsModelInitialized = isModelInitialized;
		isModelInitialized = iMI;
		firePropertyChange("isModelInitialized", oldIsModelInitialized, isModelInitialized);
	}



}
